<?php

namespace App\Http\Controllers\Basic;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use SimpleSoftwareIO\QrCode\Facades\QrCode;

class QrcodeController extends Controller
{
    public function qrcode(Request $request) {
        $data = $request->has('data') ? $request->get('data') : env('APP_URL', 'http://127.0.0.1');
        $image = QrCode::format('png')->size($request->get('size', 300))/*->merge('/storage/logo.png')*/->generate($data);
        return response($image)->header('Content-type','image/png');
    }


}
